package webdev.views;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;

public class MyListView extends ListView {

	private ListViewListener mListViewListener;
	
	public MyListView(Context context) {
	    super(context);
	}
	 
	public MyListView(Context context, AttributeSet attrs, int defStyle) {
	    super(context, attrs);
	}
	 
	public MyListView(Context context, AttributeSet attrs) {
	    super(context, attrs);
	}
	 
	public void setOnScrollUpAndDownListener(ListViewListener listViewListener) {
	    this.mListViewListener = listViewListener;
	}

	@Override
	protected void onScrollChanged(int l, int t, int oldl, int oldt) {
		super.onScrollChanged(l, t, oldl, oldt);
		if (mListViewListener != null) {
			mListViewListener.onScrollUpAndDownChanged(l, t, oldl, oldt);
	    }
	}
}
